import 'package:flutter/material.dart';
import 'package:ref/ref.dart';
import '../main.dart';
import 'has_login.dart';
import 'not_login.dart';

class AppIndex extends StatelessWidget {
  const AppIndex({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('用户首页'),
      ),
      body: Center(
        child: ListView(
          children: [
            Column(
              children: [
                RefBuilder(() {
                  String userName = rootStore.users.userInfo.value.userName;
                  return userName != '' ? HasLogin() : NotLogin();
                }),
              ],
            ),
          ],
        ),
      ),
    );
  }
}
